<?php
	session_start();
	ob_start();

	include("../../handle/config.php");
	$sql = "SELECT  MACH FROM HOIVIEN WHERE MAHV='$_SESSION[mahv]'";
	$result=mysqli_query($con,$sql);
	$row = mysqli_fetch_array($result);
	$mach=$row['MACH'];
	$sql="INSERT INTO HOIPHI VALUES ('$_POST[nam]','$mach','$_POST[mucphi]')";
	if(mysqli_query($con,$sql))
	{
		mysqli_close($con);
		header("Location:../../QuanLyHoiPhi.php?content=dshp");
	}
	else 
	{
		mysqli_close($con);
		header("Location:../../QuanLyHoiPhi.php?content=themhoiphi&result=Hội phí cho năm $_POST[nam] đã tồn tại");
	}
?>